package com.itheima.dao;

import com.itheima.pojo.Order;
import com.itheima.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OrderMapper {

    /**
     * 根据预约id查询预约信息
     * @param id
     * @return
     */
    //根据预约id查询member的name，setmeal的name，order的orderType，orderDate
    @Select("select m.name as member,s.name as setmeal,o.orderType,o.orderDate from t_order o,t_member m,t_setmeal s where o.member_id=m.id and o.setmeal_id=s.id and o.id=#{id}")
    OrderVO findById(Integer id);

    /**
     * 添加预约信息
     * @param order
     */
    void insert(Order order);
}
